/**
 * 
 */
package com.cloudcast.client.controller;


/**
 * @author Samuel García Martínez <in0de>
 *
 */
public class ControllerException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3486780049356594602L;
	private Controller source;
	
	public ControllerException(Controller source, Exception ex) {
		super(ex);
		
		this.source = source;		
	}
	
	public ControllerException(Controller source, String msg) {
		super(msg);
		
		this.source = source;
	}
	
	public Controller getSource() { 
		return this.source;
	}

	@Override
	public String getMessage() {
		return source.getId() + " throwed an exception. Cause: " + getMessage();
	}
	
}
